// 按需引入方式
import echarts from "@/views/package/echarts/components/BaseEcharts/utils/echarts";

export function getOptions(requestData) {
  console.log("requestData", requestData);

  const colorArr = [
    "#c1b7ff",
    "#192eb3",
    "#77399C",
    "#ee7c30",
    "#a67f47",
    "#389e0e",
    "#0087b9",

    "#917ed9",
    "#9ed0fe",
    "#075fff",
    "#50cffd",
    "#617def",
    "#68a4e0",
    "#09529e",
    "#3198f6",
    "#81c8da",
    "#96abfe",
    "#597cb9",
    "#ffaa31",
    "#da977f",
    "#7c553d",
    "#fec590",
    "#e7b814",
    "#d1c0a6",
    "#ac6600",
    "#edd614",
    "#d5a968",

    "#73d13c",
    "#44c29a",
    "#60f698",
    "#28a986",
    "#018c32",
    "#b8ea8e",
    "#618d03",
    "#a1cf00",
    "#526600",
  ];
  const option = {
    color: colorArr,
    legend: {
      top: "10",
      width: "70%",
      type: "scroll",
      icon: "rect",
      backgroundColor: "transparent",
      itemHeight: 13, // 图例icon高度
      itemWidth: 13, // 图例icon宽度
    },
    grid: {
      top: "15%",
      left: "40",
      right: 80, //动态计算宽度
      bottom: "8%",
      containLabel: true,
    },
    visualMap: [],
    dataZoom: [
      {
        show: true,
        height: 18,
        xAxisIndex: [0],
        bottom: "3%",
        handleSize: "110%",
        handleStyle: {
          color: "#d3dee5",
        },
        textStyle: {
          color: "#fff",
        },
        fillerColor: "#d6eaea",
        borderColor: "#aacedf",
        showDataShadow: false,
      },
      {
        type: "inside",
        show: true,
        height: 15,
        start: 1,
        end: 35,
      },
    ],




    xAxis: {
      type: "category",
      boundaryGap: false,
    },
    yAxis: {
      type: "value",
    },
    series: [
      {
        name: "Email",
        type: "line",
        stack: "Total",
        data: [120, 132, 101, 134, 90, 230, 210],
      },
      {
        name: "Union Ads",
        type: "line",
        stack: "Total",
        data: [220, 182, 191, 234, 290, 330, 310],
      },
      {
        name: "Video Ads",
        type: "line",
        stack: "Total",
        data: [150, 232, 201, 154, 190, 330, 410],
      },
      {
        name: "Direct",
        type: "line",
        stack: "Total",
        data: [320, 332, 301, 334, 390, 330, 320],
      },
      {
        name: "Search Engine",
        type: "line",
        stack: "Total",
        data: [820, 932, 901, 934, 1290, 1330, 1320],
      },
    ],
  };
  return option;
}
